package com.sky.mapper.admin;

import com.sky.pojo.DishFlavor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {


    /**
     * 批量插入口味数据
     * @param dishFlavors
     */
    void insert(@Param("dfs") List<DishFlavor> dishFlavors);

    /**
     * 根据菜品id删除口味数据
     * @param id
     */
    void deleteByDishId(Long id);

    /**
     * 根据菜品id批量删除口味数据
     * @param ids
     */
    void deleteByDishIds(@Param("ids") List<Long> ids);

    /**
     * 根据菜品id查询口味数据
      * @param id
     * @return
     */
    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> selectByDishId(Long id);
}
